package com.zhuoyue.system.mapper;

import java.util.List;

import com.zhuoyue.common.annotation.DataSource;
import com.zhuoyue.common.core.domain.ChartData;
import com.zhuoyue.system.domain.TblGateway;
import com.zhuoyue.system.domain.po.SelectTimePo;
import com.zhuoyue.system.domain.po.TblGatewayPo;
import com.zhuoyue.system.domain.vo.TblGatewayVo;
import org.apache.ibatis.annotations.Param;

import static com.zhuoyue.common.enums.DataSourceType.SLAVE;

/**
 * 网关Mapper接口
 *
 * @author hewenze
 * @date 2020-08-07
 */
@DataSource(SLAVE)
public interface TblGatewayMapper {


    /**
     * 查询网关列表
     *
     * @param tblGatewayPo 网关
     * @return 网关集合
     */
    public List<TblGatewayVo> selectTblGatewayList(TblGatewayPo tblGatewayPo);

    /**
     * 网关解绑家庭
     *
     * @param id
     * @return 网关集合
     */
    public int untieTblGateway(String id);


    String selectHomeIdByGatewayId(String id);

    String selectGatewayMacByGatewayId(String id);

    List<TblGatewayVo> selectGatewayByHomeId(@Param("homeId") String homeId);

    /**
     * 通过网关ID获取网网关的信息
     *
     * @param id
     * @return
     */
    TblGatewayVo selectGatewayVoById(@Param("id") String id);


    /**
     * 查询网关信息
     *
     * @param gatewayId
     * @param gatewayMac
     * @return
     */
    TblGatewayVo selectGatewayByGatewayId(@Param("gatewayId") String gatewayId, @Param("gatewayMac") String gatewayMac);

    /**
     * 查询一段时间内的网关新增数据
     *
     * @param selectTimePo
     * @return
     */
    List<ChartData> getGatewayCountRangeTime(SelectTimePo selectTimePo);

    /**
     * 查询网关信息
     *
     * @param gateway
     * @return
     */
    List<String> selectGatewayMessage(TblGateway gateway);

}
